<?php
/**
 * Description of UpdateCategory
 *
 * @author Tan Loi
 */
class UpdateCategory extends Category{
        public static function model($className=__CLASS__)
	{
		return parent::model($className);
	}
        public function rules()
	{
		// NOTE: you should only define rules for those attributes that
		// will receive user inputs.
		return array(
			array('name, description, position', 'required'),
			array('position', 'numerical', 'integerOnly'=>true),
			array('name', 'length', 'max'=>100),
			array('image, banner', 'length', 'max'=>255),
                        array('imagefile','file','types'=>'jpg, gif, png','allowEmpty'=>true),
			// The following rule is used by search().
			// Please remove those attributes that should not be searched.
			array('id, name, image, banner, description, position', 'safe', 'on'=>'search'),
		);
	}
}

?>
